# 官方的 Golang 镜像基于 Debian，且 workspace（GOPATH）配置为 /go
#FROM golang:latest
#FROM alpine:3.10 AS final
#FROM alpine:latest
FROM registry.cn-shenzhen.aliyuncs.com/leehuajun/alpine-tz:3.10 AS final
#FROM pangou/alpine-tz:latest
MAINTAINER LeeHuajun <lhj@cvtb.cn>

WORKDIR /
COPY ./target/release/rust-ip ./app
#ENV GIN_MODE 'release'
#ENV BASE_SERVE_URL http://47.114.5.182:8100
#因alpine镜像中并没有时区相关的包，需要下载安装才行。并设置localtime和timezone为东八区
#RUN echo 'http://mirrors.ustc.edu.cn/alpine/v3.5/main' > /etc/apk/repositories
#    && echo 'http://mirrors.ustc.edu.cn/alpine/v3.5/community' > /etc/apk/repositories
#    && apk update && apk add tzdata
#    && ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
#    && echo "Asia/Shanghai" > /etc/timezone
#RUN apk add -U tzdata
#RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
# apk add libgcc
# RUN mkdir /lib64 && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2
EXPOSE 8080

ENTRYPOINT ["./app"]